package com.company.restaurant.dto;

/**
 * Description of class.
 * Created 3/26/14 5:12 PM
 *
 * @author andrey.rodin@playtech.com
 */

public class LoginRequest extends BaseMessage {

    private static final long serialVersionUID = 1951719723547422271L;
    private String login;
    private String password;

    public LoginRequest(String login, String password) {
        super(MessageIds.LOGIN_REQUEST.getCode(), null);
        this.login = login;
        this.password = password;
    }

    public String getLogin() {
        return login;
    }

    public String getPassword() {
        return password;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof LoginRequest)) return false;

        LoginRequest that = (LoginRequest) o;

        if (!login.equals(that.login)) return false;
        if (!password.equals(that.password)) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = login.hashCode();
        result = 31 * result + password.hashCode();
        return result;
    }
}
